package com.babel.util.util;

import java.util.Arrays;
import java.util.List;

/**
 * 一些校验用的公共方法
 */
public class FileNameCheckUtil {
	public static List<String> imageTypes= Arrays.asList(new String[]{".JPG",".JPEG",".BMP",".GIF",".PNG"});
	public static List<String> videoTypes=Arrays.asList(new String[]{".MP4"});


	public static boolean isVideo(String fileName){
        if(fileName==null||!fileName.contains(".")){
            return false;
        }
		return videoTypes.contains(fileName.substring(fileName.lastIndexOf(".")).toUpperCase());
	}
	public static boolean isImage(String fileName){
        if(fileName==null||!fileName.contains(".")){
            return false;
        }
		return imageTypes.contains(fileName.substring(fileName.lastIndexOf(".")).toUpperCase());
	}


}
